namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using Engine.Report;

    using Microsoft.SharePoint;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;
    using Entities;
    using Column;

    using SharePoint.Wss.Columns;
    using SharePoint.Wss.Lists;

    using TestHelper = Collaboris.Saf.Actions.Wss.Tests.TestHelper;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class AddSiteColumnToListTest
    {
        [TestMethod]
        public void AddSiteColumnToList_Test()
        {
            WSSTestAssistant<AddSiteColumnToList, AddSiteColumnToListInfo> addsitecolumntolist =
                    new WSSTestAssistant<AddSiteColumnToList, AddSiteColumnToListInfo>(TestEnvironment.PublishingSite, 
                        "AddSiteColumnToListTestWeb", "BLANKINTERNET#0");

            using (addsitecolumntolist)
            {
                  SiteColumnHelper.CreateNewFieldInWeb(
                    addsitecolumntolist.TestWeb,
                    addsitecolumntolist.FirstEntity.FieldName,
                    SPFieldType.Text,
                    false, true);

                MacroReport doReport = addsitecolumntolist.DoMacro();

                // this will chuck an exception if the field doesn't exist in the web.
                SPListHelper.FieldExists(addsitecolumntolist.TestWeb, 
                    addsitecolumntolist.FirstEntity.ListName, 
                    addsitecolumntolist.FirstEntity.FieldName);

            }
        }

    }
}
